﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using Brouteforce.gameObjs;
//using Brouteforce.gameObjs.gamePiece;
//using Brouteforce.gameobjs;
//using Brouteforce.uiOld;
//using Brouteforce.utilities;
//using Microsoft.Xna.Framework;
//using Microsoft.Xna.Framework.Graphics;

//namespace Brouteforce.managers {
//    class DashboardManager {

//        public const int DashboardHeight = 32 * 3;
//        private static string _msg;
//        private static string _msg1;
//        private static string _msg2;
//        private static int _padding = 5;
//        private static CheckBox PSelShooter, PSelDefender, PSelKamikaz;
//        private static Textbox ALife, APower, ASpeed, ALight;
//        private static SingleSelectionGroup AttGroup, PSelGroup;

//        private static Rectangle _bounds = new Rectangle(0, GameManager.Viewport.Height - DashboardHeight, GameManager.Viewport.Width, DashboardHeight);

//        public static void Initialize() {
//            var ngpX = 420;
//            var loc = new Location(ngpX, _bounds.Y + _padding + 20, 32, 32);
//            PSelShooter = new CheckBox(new Sprite(BFGame.TileShooter, loc));
//            loc = loc.RightTo(10);
//            PSelDefender = new CheckBox(new Sprite(BFGame.TileDefender, loc));
//            loc = loc.RightTo(10);
//            PSelKamikaz = new CheckBox(new Sprite(BFGame.TileSuicideBomber, loc));


//            ngpX = 380;
//            loc = new Location(ngpX, _bounds.Y + _padding + 20 + 32 + 10, 80, 18);
//            ALife = new Textbox(loc, "life: ") { AllowOnlyNumbers = true, MaximumChars = 3 };

//            loc = loc.RightTo(10);
//            ALight = new Textbox(loc, "light: ") { AllowOnlyNumbers = true, MaximumChars = 3 };

//            loc = loc.RightTo(10);
//            APower = new Textbox(loc, "power: ") { AllowOnlyNumbers = true, MaximumChars = 3 };

//            loc = loc.RightTo(10);
//            ASpeed = new Textbox(loc, "speed: ") { AllowOnlyNumbers = true, MaximumChars = 3 };

//            AttGroup = new SingleSelectionGroup();
//            AttGroup.Add(ALife);
//            AttGroup.Add(ASpeed);
//            AttGroup.Add(APower);
//            AttGroup.Add(ALight);

//            PSelGroup = new SingleSelectionGroup();
//            PSelGroup.Add(PSelDefender);
//            PSelGroup.Add(PSelKamikaz);
//            PSelGroup.Add(PSelShooter);
//        }

//        public static void Draw() {
//            Draws.DrawBlank(_bounds, Color.Black);
//            Draws.DrawString(_bounds.X + _padding, _bounds.Y + _padding, "Player " + GameManager.Turn + " Resources : " , PlayersManager.Instance.GetCurrentPlayerColor());

//            var fh = Draws.NormalFontSize.Y;
//            Draws.DrawString(_bounds.X + _padding, (int)(_bounds.Y + fh + _padding), PlayersManager.GetCurrentPlayer().MsgToDashboard);

//            Draws.DrawString(_bounds.X + _padding, (int)(_bounds.Y + 2 * fh + _padding), PlayersManager.SelectedGamePiece.DashbordMsg, Color.SteelBlue);

//            int power, life, speed, light;
//            PlayersManager.Instance.CurrentPlayerResources(out life, out light, out speed, out power);


//            Draws.DrawString(_bounds.X + _padding, (int)(_bounds.Y + 3 * fh + _padding), "Current GamePiece Attributes: \n" + "Life:" + life + " | Power: " + power + " | Speed: " + speed + " | Light: " + light + "\n");


//            var ngpX = 380;
//            Draws.DrawString(ngpX, _bounds.Y + _padding, "New Game Piece:\nType:");
//            AttGroup.Draw(0, 0);
//            PSelGroup.Draw(0, 0);
//        }

//        public static void Update() {
//            AttGroup.Update();
//            PSelGroup.Update();
//        }

//        public static void DisplayMsgMousePassedOnTile(string msg) {
//            _msg1 = msg;
//            //PlayersManager.Players[PlayersManager.SelectedPlayer].CurrentCharacter.DashbordMsg;

//            _msg = PlayersManager.Players[PlayersManager.SelectedPlayer].CurrentCharacter.DashbordMsg +"\n" + _msg2;
//        }

//        public static void DisplayMsgPlayerResources(string msg) {
//            //MsgToDashboard
//            _msg2 = msg;
//            _msg = _msg1 + "\n" + _msg2;
//        }

//        public static GamePiece GenerateNewCharacter(Tile where)
//        {
//            CorrectData();
//            if (PSelGroup.Selection == PSelDefender)
//                return new Defender(ASpeed.TextAsInteger, ALight.TextAsInteger, ALife.TextAsInteger, APower.TextAsInteger, where, GameManager.Turn);
//            return PSelGroup.Selection == PSelShooter
//                       ? (GamePiece)
//                         new Shooter(ASpeed.TextAsInteger, ALight.TextAsInteger, ALife.TextAsInteger,
//                                     APower.TextAsInteger, @where, GameManager.Turn)
//                       : new SuicideBomber(ASpeed.TextAsInteger, ALight.TextAsInteger, ALife.TextAsInteger,
//                                           APower.TextAsInteger, @where, GameManager.Turn);
//        }

//        private static void CorrectData()
//        {
//            if (ASpeed.TextAsInteger == 0) ASpeed.Text = "0";
//            else if (ASpeed.TextAsInteger > PlayersManager.GetResources("speed"))
//                ASpeed.Text = "" + PlayersManager.GetResources("speed"); 
//            if (ALife.TextAsInteger == 0) ALife.Text = "0";
//            else if (ALife.TextAsInteger > PlayersManager.GetResources("life"))
//                ALife.Text = "" + PlayersManager.GetResources("life");
//            if (ALight.TextAsInteger == 0) ALight.Text = "0";
//            else if (ALight.TextAsInteger > PlayersManager.GetResources("light"))
//                ALight.Text = "" + PlayersManager.GetResources("light");
//            if (APower.TextAsInteger == 0) APower.Text = "0";
//            else if (APower.TextAsInteger > PlayersManager.GetResources("power"))
//                APower.Text = "" + PlayersManager.GetResources("power");
//        }

//        public static Texture2D GetCharacterTexture() {
//            if (PSelGroup.Selection == PSelDefender)
//                return BFGame.TileDefender;
//            return PSelGroup.Selection == PSelShooter ? BFGame.TileShooter : BFGame.TileSuicideBomber;
//        }
//    }
//}
